package hello.service;

import hello.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import hello.repository.UserRepository;

import java.util.List;

/**
 * Created by Administrator on 2015/11/16.
 */
@Service
public class UserService {
    @Autowired
    private UserRepository userRepository;

    public boolean save(User user){

        if(this.userRepository.save(user)!=null) return true;

        return false;
    }

    public List<User> findAll(){
        return (List<User>) this.userRepository.findAll();
    }


}
